//
//  EnterpriseView.m
//  reSearchDemo
//
//  Created by 科技 on 15/8/7.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "EnterpriseView.h"

@implementation EnterpriseView

+(EnterpriseView *)instanceView {
    NSArray* nibView =  [[NSBundle mainBundle] loadNibNamed:@"EnterpriseView" owner:nil options:nil];
    
    return [nibView objectAtIndex:0];
}

-(void)drawRect:(CGRect)rect{

    //身份证
    self.TF6.delegate=self;
    self.TF6.tag=1;
    
    //手机号
    self.TF7.delegate=self;
    self.TF7.tag=2;
    
    self.TF3.delegate=self;
    
    
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    
    NSString *text = textField.text;
    NSInteger count = text.length + string.length;
    if (textField == self.TF6 && count > 18) {
        return NO;
    }
    
    if (textField == self.TF7 && count > 11) {
        return NO;
    }
    
    if (textField == self.TF3 && count >25) {
        return NO;
    }
    return YES;

}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    
    [self.TF1 resignFirstResponder];
    [self.TF2 resignFirstResponder];
    [self.TF3 resignFirstResponder];
    [self.TF4 resignFirstResponder];
    [self.TF5 resignFirstResponder];
    [self.TF6 resignFirstResponder];
    [self.TF7 resignFirstResponder];
    [self.TF8 resignFirstResponder];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
